  	//设置网页打印的页眉页脚为空
		function pagesetup(){
			var hkey_root,hkey_path,hkey_key;
			hkey_root="HKEY_CURRENT_USER";
			hkey_path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
			var pageSizePath = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\Print\\Printers\\四通 5760SP (副本 1)\\DsDriver\\printMediaReady";
			try{
				var RegWsh = new ActiveXObject("WScript.Shell");
				hkey_key="header";
				RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"");
				hkey_key="footer";
				RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"");
				RegWsh.RegWrite(pageSizePath,"A3");
			}catch(e){
				alert(e.message);
			}
		}
	
		//打印当前页面
		function printPage(){
	  		if (window.print) {
				top.autoPrintIFrame.document.execCommand("Print"); 
	   		}else{
	   			alert("此功能不支持IE以外的浏览器。");
	   		}
		}
		
		//自动关闭页面
		function closePage(){
			var autoPrintDiv = top.document.getElementById("autoPrintDiv");
			var children = autoPrintDiv.childNodes;
			for(i=0; i<children.length; i++){
				autoPrintDiv.removeChild(children[i]);	
			}	
		}
		
		//判断是否是IE
		function isIE(){
			var navigatorName = "Microsoft Internet Explorer";   
			var res = false;   
			if( navigator.appName == navigatorName ){   
				res = true;
			}
			return res;
		}
		
		function autoPrint(){
			if(!isIE()){
				alert("此功能不支持IE以外的浏览器。");
				return;
			}
			pagesetup();
			printPage();
			//closePage();
		}
